/**
 * Created with IntelliJ IDEA.
 * User: ajhin
 * Date: 3/3/14
 * Time: 9:51 PM
 * To change this template use File | Settings | File Templates.
 */
package com.societyGames.codeAlong.state.loading
{
import com.societyGames.codeAlong.codeExercise.Compiler;
import com.societyGames.codeAlong.state.codeExercise.CodeExerciseState;
import com.societyGames.codeAlong.state.codeExercise.model.ExceptionsData;
import com.societyGames.codeAlong.state.codeExercise.model.ModuleData;
import com.societyGames.codeAlong.state.codeExercise.model.SharedData;
import com.societyGames.codeAlong.state.codeExercise.model.SyntaxErrorsData;
import com.societyGames.codeAlong.state.codeExercise.view.TextDialog;
import com.societyGames.codeAlong.user.PersistentUserData;
import com.societyGames.flashForms.DialogManager;
import com.societyGames.system.FileCache;

/**
 * On starting the game, if the state is empty and we can't flush to shared object
 * show this state which shows an error dialog and starts the first mission
 */
public class FlushFailedState extends CodeExerciseState
{
  public function FlushFailedState(userData:PersistentUserData, moduleData:ModuleData, moduleDatas:Vector.<ModuleData>, sharedData:SharedData, syntaxErrorsData:SyntaxErrorsData, exceptionsData:ExceptionsData, compiler:Compiler, fileCache:FileCache)
  {
    super(userData, moduleData, moduleDatas, sharedData, syntaxErrorsData, exceptionsData, compiler, fileCache);
    var windowName:String = "";
    var hypertext:String = "<body>To automatically save your progress:<br>1) Right click here.<br>2) Click \"Settings...\".<br>3) Click the Folder icon.<br>4) Uncheck \"Never Ask Again\".<br>5) Move the slider to 100kb.</body>";
    var textDialog:TextDialog = new TextDialog(windowName, hypertext);
    DialogManager.instance.showDialog(textDialog)
  }
}
}
